package flc.ast.bean;

import static androidx.room.ForeignKey.CASCADE;

import androidx.annotation.Keep;
import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.ForeignKey;
import androidx.room.Ignore;
import androidx.room.PrimaryKey;

@Keep
@Entity(tableName = "images",
        foreignKeys = @ForeignKey(
                entity = Album.class,
                parentColumns = "id",
                childColumns = "albumId",
                onDelete = CASCADE))
public class Image {
    @PrimaryKey(autoGenerate = true)
    public int id;
    @ColumnInfo(name = "albumId", index = true)
    public int albumId;
    public String path;
    public boolean isFavorite;
    public String tags;
    public String city;
    public long time;

    public Image() {
    }

    @Ignore
    public Image(int albumId, String path, boolean isFavorite, String tags, String city, long time) {
        this.albumId = albumId;
        this.path = path;
        this.isFavorite = isFavorite;
        this.tags = tags;
        this.city = city;
        this.time = time;
    }

    @Ignore
    public Image(int id, int albumId, String path, boolean isFavorite, String tags, String city, long time) {
        this.id = id;
        this.albumId = albumId;
        this.path = path;
        this.isFavorite = isFavorite;
        this.tags = tags;
        this.city = city;
        this.time = time;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getAlbumId() {
        return albumId;
    }

    public void setAlbumId(int albumId) {
        this.albumId = albumId;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public boolean isFavorite() {
        return isFavorite;
    }

    public void setFavorite(boolean favorite) {
        isFavorite = favorite;
    }

    public String getTags() {
        return tags;
    }

    public void setTags(String tags) {
        this.tags = tags;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public long getTime() {
        return time;
    }

    public void setTime(long time) {
        this.time = time;
    }
}
